//package com.xzit.model;
//
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.AllArgsConstructor;
//import lombok.Data;
//import lombok.NoArgsConstructor;
//
//@Data
//
//@ApiModel(value = "学生对象",description = "学生对象，用来对应数据库表student")
//public class Student {
//    @ApiModelProperty(value = "学生id",required = true,example = "1")
//    private int id;
//    @ApiModelProperty(value = "学生姓名",required = true,example = "李四")
//    private String name;
//    @ApiModelProperty(value = "学生性别",required = true,example = "男")
//    private String gender;
//    @ApiModelProperty(value = "学生年龄",required = false,example = "12")
//    private int age;
//
//    public Student(int id, String name, String gender, int age) {
//        this.id = id;
//        this.name = name;
//        this.gender = gender;
//        this.age = age;
//    }
//
//    public Student() {
//    }
//}
package com.xzit.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(description = "学生实体类") // 用于类注释
public class Student {

    @ApiModelProperty(value = "学生ID", example = "1")
    private int id;

    @ApiModelProperty(value = "学生姓名", example = "张三")
    private String name;

    @ApiModelProperty(value = "学生性别", example = "男")
    private String gender;

    @ApiModelProperty(value = "学生年龄", example = "20")
    private int age;

    // 构造方法
    public Student() {}

    public Student(int id, String name, String gender, int age) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    // Getter 和 Setter
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    // toString
    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", age=" + age +
                '}';
    }
}
